package com.team2.s3hrjyxm.QxglService;

import com.team2.s3hrjyxm.dao.UsersDao;
import com.team2.s3hrjyxm.pojo.Role;
import com.team2.s3hrjyxm.pojo.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional
public class UserServiceImp implements UserService{
         @Autowired
         UsersDao dao;

    @Override
    public List<Map> userquery() {
        return dao.userquery();
    }

    @Override
    public List<Role> yhsfquery() {
        return dao.yhsfquery();
    }
    @Transactional
    @Override
    public int useradd(Users r) {
        return dao.useradd(r);
    }

    @Override
    public Map userquerybyid(int u_id) {
        return dao.userquerybyid(u_id);
    }

    @Override
    @Transactional
    public void userdelete(int u_id) {
           dao.userdelete(u_id);
    }

    @Override
    @Transactional
    public void userupdate(Users u) {
           dao.userupdate(u);
    }
}
